Knowledge7

The Linux and Mobile Solution Provider

  • About
  • Training
  • Services
  • Clients
  • In the news
  • Blog
  • Contact Us
You are here: Home / Topic / Design Patterns

Design Patterns

This topic is part of our Object-Oriented Programming in PHP training

A Design Pattern is a solution which experienced software developers have been using over the years when they have to solve a given type of problem. The most popular book covering the fundamental Design Patterns is:

Useful design patterns include:

  • creational patterns like Abstract factory and Singleton,
  • structural patterns like Adapter (or Façade) and Composite and
  • behavioral patterns like Observer and Strategy

Exercises

We will implement an event database using our knowledge of object-oriented programming and design patterns.

The domain logic of the web application is:

Implement the following:

  1. User domainlogic class with its unit test
  2. Event domainlogic class with its unit test
  3. Repository domainlogic class with its unit test (together with helper classes if needed)

The persistence layer of the application is based on the Strategy design pattern. Implement:

  1. The Database and the Engine interface (its concrete classes will be implemented later…)
  2. InMemoryEngine which manages data in memory.
  3. Create a main menu as well as functionality to show all events
  4. Show events for a specific period
  5. Show events by keyword
  6. Show events falling on a specific date
  7. Create a new event (not really useful because we are using an in memory database…)
  8. Consequently, replace the in memory database engine by a MySQL database engine.
This topic is part of our Object-Oriented Programming in PHP training

Our forthcoming training courses

  • No training courses are scheduled.

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for something?

Want to know more?

Get our newsletter

Discover the latest news, tips and tricks on Linux, the Web and Mobile technologies every week for FREE

This work is licensed by Knowledge7 under an Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.